package io.github.mymonstercat.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@ConfigurationProperties(prefix = "location")
public class LocationProperties {

    private List<OrgPoint> points;

    // Getter and Setter
    public List<OrgPoint> getPoints() {
        return points;
    }

    public void setPoints(List<OrgPoint> points) {
        this.points = points;
    }

    public static class OrgPoint {
        private String text;
        private List<Double> coordinates;

        // Getters and Setters
        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public List<Double> getCoordinates() {
            return coordinates;
        }

        public void setCoordinates(List<Double> coordinates) {
            this.coordinates = coordinates;
        }

        @Override
        public String toString() {
            return "Point{" +
                    "text='" + text + '\'' +
                    ", coordinates=" + coordinates +
                    '}';
        }
    }

    public static void main(String[] args) {

        LocationProperties locationProperties = new LocationProperties();
        List<OrgPoint> points1 = locationProperties.getPoints();
        System.out.println(points1);
    }
}